/*
 * @Author: 大D
 * @email: 857216393@qq.com
 * @Date: 2024-01-18 15:47:26
 * @Description:分类相关接口
 */
//引入
import http from '@/apis/request/http';
import type { Res, ICategory } from './type';
export const getCategoryList = () => {
  return http<Res<Array<ICategory>>>({
    url: '/category/list'
  });
};
export const addCategory = (params: ICategory) => {
  return http<Res>({
    url: '/category/_token/add',
    method: 'post',
    data: params
  });
};
export const editCategory = (params: ICategory) => {
  return http<Res>({
    url: '/category/_token/update',
    method: 'put',
    data: params
  });
};
export const deleteCategory = (params: ICategory) => {
  return http<Res>({
    method: 'delete',
    url: '/category/_token/delete',
    data: params,
    cancel: false
  });
};
